﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace Core.SpellBehaviors
{
    public class ChangeHP : ISpellBehavior
    {
        private int damage;
        public ChangeHP(string damage)
        {
            this.damage = int.Parse(damage);
        }
        public void Apply(IEntity speller, IEnumerable<IEntity> targets)
        {
            foreach (var target in targets)
            {
                target.HP += damage;
            }
        }

        public override string ToString()
        {
            if (damage > 0)
            {
                return $"Restore {damage}";
            }
            else
            {
                return $"Hurt {Mathf.Abs(damage)}";
            }
        }
    }
}
